// 岗位相关的接口函数
import request from '@/utils/http.js'

//1.添加岗位
export const addJobAPI = (data) => {
    return request({
        url: '/job/addJob',
        method: 'post',
        data: {
            jobCompanyId: data.job_company_id,
            jobTitle: data.job_title,
            jobLocation: data.job_location,
            jobSalary: data.job_salary,
            jobEducationRequirement: data.job_education_requirement,
            jobMajorRequirement: data.job_major_requirement,
            jobExperienceRequirement: data.job_experience_requirement,
            jobSkillRequirement: data.job_skill_requirement,
            jobDescription: data.job_description,
            jobBenefits: data.job_benefits,
            jobPublishDate: data.job_publish_date,
            jobDeadline: data.job_deadline,
            jobContactInfo: data.job_contactinfo,
            jobStatus: data.job_status,
            jobIndustry: data.job_industry
        }
    })
}
//2.分页获取岗位列表
export const pageJobAPI = (data) => {
    return request({
        url: '/job/pageJob',
        method: 'post',
        data: {
            pageCurrent: data.pageCurrent,
            pageSize: data.pageSize,
            jobStatus: data.jobStatus,
            jobAdminStatus: data.jobAdminStatus,
            jobIndustry: data.job_industry,
            jobLocation: data.job_address,
            searchName: data.searchName,
            jobCompanyId: data.enterprise_id
        }
    })
}
//3.更新岗位
export const updateJobByIdAPI = (data) => {
    return request({
        url: '/job/updateJobById',
        method: 'post',
        data: {
            jobId: data.jobId,
            jobTitle: data.job_title,
            jobLocation: data.job_location,
            jobSalary: data.job_salary,
            jobEducationRequirement: data.job_education_requirement,
            jobMajorRequirement: data.job_major_requirement,
            jobExperienceRequirement: data.job_experience_requirement,
            jobSkillRequirement: data.job_skill_requirement,
            jobDescription: data.job_description,
            jobBenefits: data.job_benefits,
            jobPublishDate: data.job_publish_date,
            jobDeadline: data.job_deadline,
            jobContactInfo: data.job_contactinfo,
            jobStatus: data.job_status,
            jobIndustry: data.job_industry
        }
    })
}
//4.删除岗位
export const deleteJobAPI = (jobId) => {
    return request({
        url: '/job/deleteJob',
        method: 'post',
        params: {jobId}
    })
}
//5.获取岗位详情
export const queryJobDetailByJobIdAPI = (jobId) => {
    return request({
        url: '/job/queryJobDetailByJobId',
        method: 'post',
        params: {jobId}
    })
}
//6.更改岗位管理状态
export const updateJobStatusAPI = (jobId, userStatus) => {
    return request({
        url: '/job/updateJobStatus',
        method: 'post',
        params: {
            jobId: jobId,
            jobAdminStatus: userStatus
        }
    })
}
//7.管理员获取岗位信息
export const queryJobByJobIdAPI = (jobId) => {
    return request({
        url: '/job/queryJobByJobId',
        method: 'post',
        params: {
            jobId: jobId,
        }
    })
}
//8.学生首页获取热招岗位
export const queryHotJobAPI = () => {
    return request({
        url: '/job/queryHotJob',
        method: 'post',
        params: {}
    })
}
//9.获取企业岗位列表
export const queryJobByEnterpriseIdAPI = (enterpriseId) => {
    return request({
        url: '/job/queryJobByEnterpriseId',
        method: 'post',
        params: {
            enterpriseId: enterpriseId,
        }
    })
}
//10.获取期望行业的全部岗位
export const queryJobByJobIndustryAPI = (jobIndustry) => {
    return request({
        url: '/job/queryJobByJobIndustry',
        method: 'post',
        data:  jobIndustry,
    })
}
//11.获取期望职位的全部岗位
export const queryJobByJobPositionAPI = (jobPosition) => {
    return request({
        url: '/job/queryJobByJobPosition',
        method: 'post',
        data: jobPosition,
    })
}
//12.获取企业的岗位标题
export const queryJobTitleByEnterpriseIdAPI = (enterpriseId) => {
    return request({
        url: '/job/queryJobTitleByEnterpriseId',
        method: 'post',
        params: {
            enterpriseId: enterpriseId,
        }
    })
}
//13.获取企业的岗位的所属行业
export const queryJobIndustryByEnterpriseIdAPI = (enterpriseId) => {
    return request({
        url: '/job/queryJobIndustryByEnterpriseId',
        method: 'post',
        params: {
            enterpriseId: enterpriseId,
        }
    })
}


























